/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package lab07;

/**
 *
 * @author Johnny
 */
public class Control {
  private Auto objects[];
  
  public Control(int n, RaceCanvas parent) {
    objects = new Auto[n];
    for (int i=0; i<n; i++) {
      objects[i] = new Auto(i,parent);
    }

    Auto.stop = false;
    for (int i=0; i<n; i++) {
      objects[i].start();
    }

  }

  public void stopAll() {
    Auto.stop = true;
  }
}
